Tutorial Part I

Creating a new Glyphic Codeworks document

In the instructions that follow,  bulleted items indicate the sequence of actions you should take, while other text is commentary on those actions.

•
Install Glyphic Codeworks if you haven’t already done so.
•
Launch Glyphic Codeworks™.
•
Cancel the file chooser dialog.
•
Select New from the File menu.
•
Select Save As from the File menu.

The list in the upper left of the document contains all of the document’s folders.  Each folder contains a list of objects.  Most of the folders start off empty, but if you select a folder, such as the “system classes” folder,  the objects in that folder will appear in the list in the upper right corner.

Creating a class

•
From the Utilities menu, select New Class....

The ‘class creator’ will open.

•
Edit the Class name to read “Film”.
•
Set “Make class folder” pop-up choice to “true”.
•
Click on  Create & Close.

Notice that the class is automatically added to the user classes folder.  (If the user classes folder is not selected, clock on it to select it.)  In addition, a new folder named “film folder” is added to the folder list in the upper left.

A grid appears inside the window for the Film class.  This grid is called an aligner and will be used to hold the properties that are added to the class.

 

Adding properties to a class

•
Command-click in the upper left grid cell of Film.
•
Select Insert View... from the pop-up menu.
•
Select Label from the pop-up menu.
•
Command-click on the new item.
•
Select Rename from the pop-up menu to rename it to “Title:”.

In general, you can command-click on any item (or title bar) to bring up a context specific pop-up menu.

•
Command-click in the grid to the right of “Title:”.
•
Select Insert View.../String Field from the pop-up menu.
•
Rename the new item to “title” as above.

The string field will still have a value of “abc”.  Changing its property name only changes the name by which it is referenced, not its value.

Note that an existing field can be copied to a new grid location by dragging the existing field with the command key held down.

•
Add a label named “Category:” below “Title:”. 
•
To the right of that, insert a string field.
•
Rename the property of the new item to “category”. 
•
Add a label named “Rating:” and a string field with the property name of “rating” to the next row.
•
Add a Text Note to the lower right cell of Film.

Now switch Film from author to user mode and set default values for all the fields.   The default values are the initial values for new films.

•
With the Film window on top, type the escape key.

 Notice that in user mode the aligner grid is not drawn.

•
Edit the Title to "no title".
•
Edit the Category to "-".
•
Edit the Rating to "*****".
•
Edit the text note to "comments".

Using a class

Before starting this section, you will probably want to either close Film to get it out of the way, or drag it so that most of it is off the screen.  If you do close Film, you can reopen it by selecting “user classes” in the folder list and then double-clicking on Film in the list in the upper right.

There should be a folder in the folder list (in the upper left of the document) named film folder.  If this is not the case, create one now by command-clicking in the folder list, choosing Create from the pop-up menu, and entering “film folder” in the resulting dialog.

•
Click on the film folder in the folder list.
•
Command-click in the film folder’s list (the upper right list).
•
Select Create from the resulting pop-up menu.

An instance of the Film class is created and inserted into the film folder.

•
Double-click on the new film.
•
Fill in the title, category, and rating and write in the note about the film if you like.

Add several more films to the film folder.  Notice that all the films have the same name:  a Film.  It would be nice to change that to something more descriptive...

Overriding child-name for Film

 The default name for all films is  “a film” (as you can see by looking at the films in the film folder).  By overriding the child-name property in Film, you can give its instances more descriptive names.

•
Command-click in the title bar of Film.
•
Select Override...
•
Select "child-name" in the pop-up menu.

A script editor for child-name will appear.  It will already be filled out with sample text for child-name (including a comment in italics at the top).  All of that text can be deleted.

•
Edit the script for “Film.child-name” so that it reads (including bolding and punctuation):

return title && rating.

 You can select text and use command-b for bold text, command-p for plain, command-i for italic, and command-u for strikeout. 

•
Click on Save.
•
Close the script editor.

The names of the films in the film folder will change to reflect the script you just wrote.